<?php

class Controller {

    protected $model = null;
    protected $view;
    protected $params = array();

    function __construct()
    {
	// Set the params
	$this->params = Application::$params;
        // Check if the model exists if yes load it
        $model_class = Application::$controller . '_Model';
        $file = "application/models/" . Application::format_controller_file() . ".php";
        if (file_exists($file))
        {
            require_once($file);
        }
        // Create the view corresponding to this controller
        $this->view = new View(Application::format_controller_file());
    }
}